3.6.79 \(\int (c+d x^{-1+n}) (a+b x^n) \, dx\) [579]

Optimal. Leaf size=41 \[ a c x+\frac {a d x^n}{n}+\frac {b d x^{2 n}}{2 n}+\frac {b c x^{1+n}}{1+n} \]

[Out]

a*c*x+a*d*x^n/n+1/2*b*d*x^(2*n)/n+b*c*x^(1+n)/(1+n)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {1905, 14} \begin {gather*} a c x+\frac {a d x^n}{n}+\frac {b c x^{n+1}}{n+1}+\frac {b d x^{2 n}}{2 n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x^(-1 + n))*(a + b*x^n),x]

[Out]

a*c*x + (a*d*x^n)/n + (b*d*x^(2*n))/(2*n) + (b*c*x^(1 + n))/(1 + n)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 1905

Int[((A_) + (B_.)*(x_)^(m_.))*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Dist[A, Int[(a + b*x^n)^p, x], x] +
 Dist[B, Int[x^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, A, B, m, n, p}, x] && EqQ[m - n + 1, 0]

Rubi steps

\begin {align*} \int \left (c+d x^{-1+n}\right ) \left (a+b x^n\right ) \, dx &=c \int \left (a+b x^n\right ) \, dx+d \int x^{-1+n} \left (a+b x^n\right ) \, dx\\ &=a c x+\frac {b c x^{1+n}}{1+n}+d \int \left (a x^{-1+n}+b x^{-1+2 n}\right ) \, dx\\ &=a c x+\frac {a d x^n}{n}+\frac {b d x^{2 n}}{2 n}+\frac {b c x^{1+n}}{1+n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 42, normalized size = 1.02 \begin {gather*} \frac {2 a \left (c n x+d x^n\right )+b x^n \left (\frac {2 c n x}{1+n}+d x^n\right )}{2 n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x^(-1 + n))*(a + b*x^n),x]

[Out]

(2*a*(c*n*x + d*x^n) + b*x^n*((2*c*n*x)/(1 + n) + d*x^n))/(2*n)

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 43, normalized size = 1.05

method result size
risch \(a c x +\frac {b d \,x^{2 n}}{2 n}+\frac {\left (n b c x +a d n +a d \right ) x^{n}}{n \left (1+n \right )}\) \(43\)
norman \(a c x +\frac {a d \,{\mathrm e}^{n \ln \left (x \right )}}{n}+\frac {b c x \,{\mathrm e}^{n \ln \left (x \right )}}{1+n}+\frac {b d \,{\mathrm e}^{2 n \ln \left (x \right )}}{2 n}\) \(45\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*x^(-1+n))*(a+b*x^n),x,method=_RETURNVERBOSE)

[Out]

a*c*x+1/2*b*d/n*(x^n)^2+(b*c*n*x+a*d*n+a*d)/n/(1+n)*x^n

________________________________________________________________________________________

Maxima [A]
time = 0.31, size = 39, normalized size = 0.95 \begin {gather*} a c x + \frac {b d x^{2 \, n}}{2 \, n} + \frac {b c x^{n + 1}}{n + 1} + \frac {a d x^{n}}{n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*x^(-1+n))*(a+b*x^n),x, algorithm="maxima")

[Out]

a*c*x + 1/2*b*d*x^(2*n)/n + b*c*x^(n + 1)/(n + 1) + a*d*x^n/n

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 56, normalized size = 1.37 \begin {gather*} \frac {2 \, {\left (a c n^{2} + a c n\right )} x + {\left (b d n + b d\right )} x^{2 \, n} + 2 \, {\left (b c n x + a d n + a d\right )} x^{n}}{2 \, {\left (n^{2} + n\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*x^(-1+n))*(a+b*x^n),x, algorithm="fricas")

[Out]

1/2*(2*(a*c*n^2 + a*c*n)*x + (b*d*n + b*d)*x^(2*n) + 2*(b*c*n*x + a*d*n + a*d)*x^n)/(n^2 + n)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 163 vs. \(2 (36) = 72\).
time = 0.31, size = 163, normalized size = 3.98 \begin {gather*} \begin {cases} a c x - \frac {a d}{x} + b c \log {\left (x \right )} - \frac {b d}{2 x^{2}} & \text {for}\: n = -1 \\\left (a + b\right ) \left (c x + d \log {\left (x \right )}\right ) & \text {for}\: n = 0 \\\frac {2 a c n^{2} x}{2 n^{2} + 2 n} + \frac {2 a c n x}{2 n^{2} + 2 n} + \frac {2 a d n x^{n}}{2 n^{2} + 2 n} + \frac {2 a d x^{n}}{2 n^{2} + 2 n} + \frac {2 b c n x x^{n}}{2 n^{2} + 2 n} + \frac {b d n x^{2 n}}{2 n^{2} + 2 n} + \frac {b d x^{2 n}}{2 n^{2} + 2 n} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*x**(-1+n))*(a+b*x**n),x)

[Out]

Piecewise((a*c*x - a*d/x + b*c*log(x) - b*d/(2*x**2), Eq(n, -1)), ((a + b)*(c*x + d*log(x)), Eq(n, 0)), (2*a*c
*n**2*x/(2*n**2 + 2*n) + 2*a*c*n*x/(2*n**2 + 2*n) + 2*a*d*n*x**n/(2*n**2 + 2*n) + 2*a*d*x**n/(2*n**2 + 2*n) +
2*b*c*n*x*x**n/(2*n**2 + 2*n) + b*d*n*x**(2*n)/(2*n**2 + 2*n) + b*d*x**(2*n)/(2*n**2 + 2*n), True))

________________________________________________________________________________________

Giac [A]
time = 1.43, size = 65, normalized size = 1.59 \begin {gather*} \frac {2 \, a c n^{2} x + 2 \, b c n x x^{n} + 2 \, a c n x + b d n x^{2 \, n} + 2 \, a d n x^{n} + b d x^{2 \, n} + 2 \, a d x^{n}}{2 \, {\left (n^{2} + n\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*x^(-1+n))*(a+b*x^n),x, algorithm="giac")

[Out]

1/2*(2*a*c*n^2*x + 2*b*c*n*x*x^n + 2*a*c*n*x + b*d*n*x^(2*n) + 2*a*d*n*x^n + b*d*x^(2*n) + 2*a*d*x^n)/(n^2 + n
)

________________________________________________________________________________________

Mupad [B]
time = 5.06, size = 38, normalized size = 0.93 \begin {gather*} a\,c\,x+\frac {a\,d\,x^n}{n}+\frac {b\,d\,x^{2\,n}}{2\,n}+\frac {b\,c\,x\,x^n}{n+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x^(n - 1))*(a + b*x^n),x)

[Out]

a*c*x + (a*d*x^n)/n + (b*d*x^(2*n))/(2*n) + (b*c*x*x^n)/(n + 1)

________________________________________________________________________________________